import java.util.Scanner;

public class text1 {
    public static void main(String[] args) {
        String rightUsername = "zhangsan";
        String rightPassword = "123456789";
        Scanner sc = new Scanner(System.in);
        for (int i = 0; i < 3; i++) {
            System.out.println("请输入用户名");
            String Username = sc.next();
            System.out.println("请输入密码");
            String Password = sc.next();
            if(Username.equalsIgnoreCase(rightUsername) && Password.equalsIgnoreCase(rightPassword)) {
                System.out.println("登陆成功!");
                break;
            }else {
                if(i == 2)
                {
                    System.out.println("账号被锁定,请联系客服!");
                }else {
                    System.out.println("登陆失败,用户名或密码错误,请重新输入,还剩" + (2 - i) + "次机会");
                }
            }
        }
    }
}
